package leetcodecompetition.D360;

/**
 * @Author: Siantar
 * @Date: 2023-08-27-10:31
 * @Description: 1.0
 */
public class T8015 {
    public int furthestDistanceFromOrigin(String moves) {
        int a = 0, b = 0;
        for (char move : moves.toCharArray()) {
            if (move == 'L') a++;
            if (move == 'R') a--;
            if (move == '_') b++;
        }
        return Math.abs(a) + b;
    }
}
